//
//  PPImageFlowViewController.h
//  pickpic
//
//  Created by Jinxiao on 9/4/16.
//  Copyright © 2016 MicroDream. All rights reserved.
//

#import "PPAbstractViewController.h"

@class PPImageFlowCell;
@class PPImageFlowItem;

@protocol PPImageFlowCellDelegate <NSObject>

- (void)imageFlowCell:(PPImageFlowCell *)imageFlowCell didChangeSelection:(BOOL)selection forImageFlowItem:(PPImageFlowItem *)imageFlowItem;

@end

@interface PPImageFlowItem : NSObject

@property (readwrite, nonatomic, strong) NSString *URLString;

@property (readwrite, nonatomic, strong) NSURL *URL;

@property (readwrite, nonatomic, strong) UIImage *image;

@property (readwrite, nonatomic, assign) BOOL selected;

@property (readwrite, nonatomic, strong) id representedObject;

@end

@interface PPImageFlowCell : UICollectionViewCell

@property (readwrite, nonatomic, strong) PPImageFlowItem *item;

@property (readwrite, nonatomic, weak) id<PPImageFlowCellDelegate> delegate;

@end

@class PPImageFlowViewController;

@protocol PPImageFlowViewControllerDelegate <NSObject>

- (void)flowViewController:(PPImageFlowViewController *)flowViewController didSelectFlowItem:(PPImageFlowItem *)flowItem atIndex:(NSInteger)index;

@end

@interface PPImageFlowViewController : UIViewController <UICollectionViewDelegate, UICollectionViewDataSource>

@property (readwrite, nonatomic, weak) id<PPImageFlowViewControllerDelegate> delegate;

@property (readwrite, nonatomic, strong) NSArray <PPImageFlowItem *> *items;

@property (readwrite, nonatomic, assign) BOOL editing;

@property (readonly) UICollectionView *collectionView;

- (void)selectedItemsDidChanged;

- (void)reloadData;


- (UIView *)emptyPromptViewForError:(NSError *)error;

@end
